
Page({

  /**
   * 页面的初始数据
   */
  data: {
    schema:[
      {
        label:'需要拨打的电话号码',
        prop:'phoneNumber',
        type:'text'
      }
    ],
    formData:{
      phoneNumber: ''
    },
    title: '',
    result: '',
    remark: '',
    webUrl: '',
    apiName: ''
  },
  onLoad(options) {
    console.log('options', options)
    wx.setNavigationBarTitle({
      title: options.title,
    })
    
    this.setData({
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e) {
    this.setData({
      formData: e.detail.formData
    })
  },
  choose1(e) {
    const that = this;
    setTimeout(() => {
      wx.makePhoneCall({
        phoneNumber: this.data.formData.phoneNumber,
        success(res) {
          that.setData({
            result: res,
            apiName: e.currentTarget.dataset.apiname
          })
        },
        fail(err) {
          that.setData({
            result: err,
            apiName: e.currentTarget.dataset.apiname
          })
        }
      })
    }, 1000);
  },
  onUnload() {
  }
})